﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApplication4
{
    public class DBhelper
    {
        public static DataTable GetDataTable(string sql) 
        {
            string conString = "server=.;database=Students;uid=sa;pwd=12345678";

            SqlConnection connection = new SqlConnection(conString);

            SqlDataAdapter adapter = new SqlDataAdapter();

            connection.Open();

            DataTable dt = new DataTable();

            adapter.Fill(dt);

         //  DataGridView1.DataSource = dt;
            return dt;
        }

        public static string conString { get; set; }

        internal static object AddOrUpdate(string sql)
        {
            throw new NotImplementedException();
        }
    }
}
